<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>自定义指令（局部）</title>
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<h1 v-dl-title="con"></h1>
		</div>
		<script type="text/javascript">
			const vm = new Vue({
				el:'#app',
				data:{
					con:'天增岁月人增寿，春满乾坤福满堂。'
				},
				directives:{//加s
					'dl-title':{
						bind(el, binding){
							//split 把字符串分割成数组
							//reverse 数组倒序
							//join 数组转字符串
							el.innerHTML = binding.value.split("").reverse().join("");
						}
					}
				}
			})
		</script>
	</body>
</html>
